package org.xlh.springboot.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.xlh.springboot.bean.Address;

@Configuration
public class AppConfig2 {

    //假设Address是第三方库提供的类，我们使用以下方式可以完成配置到bean的属性的绑定
    @Bean
    @ConfigurationProperties(prefix = "other.abc")
    public Address address() {
        return new Address();
    }
}
